<?php
$client = stream_socket_client('tcp://0.0.0.0:9001');

fwrite($client, 'Hello father' . PHP_EOL);

while (! feof($client)) {
    echo fgets($client, 1024);
}

fclose($client);